package com.bstek.uflo.form.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;

import com.bstek.dorado.web.resolver.AbstractResolver;
import com.bstek.uflo.command.CommandService;
import com.bstek.uflo.form.command.SaveFormCommand;

/**
 * @author Jacky.gao
 * @since 2013年11月6日
 */
public class SaveFormController extends AbstractResolver {
	private CommandService commandService;
	@Override
	protected ModelAndView doHandleRequest(HttpServletRequest request,HttpServletResponse response) throws Exception {
		String content=request.getParameter("content");
		String name=request.getParameter("name");
		String id=request.getParameter("id");
		String tableId=request.getParameter("tableId");
		commandService.executeCommand(new SaveFormCommand(Long.valueOf(tableId), content,name,id));
		return null;
	}
	public CommandService getCommandService() {
		return commandService;
	}
	public void setCommandService(CommandService commandService) {
		this.commandService = commandService;
	}
}
